<template>
  <button class="callback-btn" @click="goToHome">
    <i class="callback-icon">🏠</i>
    <span class="callback-text">{{ text }}</span>
  </button>
</template>

<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { useLanguageStore } from '@/store/languageStore';

// 获取路由器实例
const router = useRouter();
// 获取语言存储实例
const languageStore = useLanguageStore();

// 文本内容
const text = ref(languageStore.t('back'));

// 返回首页功能
const goToHome = () => {
  router.push('/chat/home');
};
</script>

<style scoped lang="less">
.callback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #1989fa;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  margin-bottom: 20px;
  
  &:hover {
    background-color: #40a9ff;
    box-shadow: 0 2px 8px rgba(25, 137, 250, 0.3);
  }
  
  &:active {
    background-color: #096dd9;
  }
  
  .callback-icon {
    font-size: 16px;
    margin-right: 8px;
    line-height: 1;
  }
  
  .callback-text {
    font-weight: 500;
  }
  
  // 移动端样式调整
  @media (max-width: 767px) {
    padding: 6px 12px;
    font-size: 13px;
    
    .callback-icon {
      font-size: 14px;
    }
  }
}
</style>